package JUC;


public enum CountryEnum {

    ONE(1, "齐"),TWO(2, "楚"),THREE(3, "燕"),FOUR(4, "赵"),FIVE(5, "魏"),SIX(6, "韩");

    private Integer retCode;
    private String retMessage;

    CountryEnum(Integer retCode, String retMessage) {
        this.retCode = retCode;
        this.retMessage = retMessage;
    }

    public static CountryEnum forEachCountry(int index){
        CountryEnum[] arr = CountryEnum.values();
        for (CountryEnum country : arr){
            if (index == country.retCode){
                return country;
            }
        }
        return null;
    }
}
